<?php

use yii\db\Migration;

class m180610_151509_migration extends Migration
{
    public function up()
    {
        /* 取消外键约束 */
        $this->execute('SET foreign_key_checks = 0');
        
        /* 创建表 */
        $this->createTable('{{%migration}}', [
            'version' => 'varchar(180) NOT NULL',
            'apply_time' => 'int(11) NULL',
            'PRIMARY KEY (`version`)'
        ], "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4");
        
        /* 索引设置 */
        
        
        /* 表数据 */
        $this->insert('{{%migration}}',['version'=>'m000000_000000_base','apply_time'=>'1528638547']);
        $this->insert('{{%migration}}',['version'=>'m180307_012054_addon_app_example_curd','apply_time'=>'1528638552']);
        $this->insert('{{%migration}}',['version'=>'m180307_012054_api_access_token','apply_time'=>'1528638552']);
        $this->insert('{{%migration}}',['version'=>'m180307_012054_api_log','apply_time'=>'1528638552']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_common_provinces','apply_time'=>'1528638555']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_live_room','apply_time'=>'1528638555']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_member','apply_time'=>'1528638555']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_member_address','apply_time'=>'1528638555']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_member_auth','apply_time'=>'1528638555']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_sys_action_log','apply_time'=>'1528638555']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_sys_addons','apply_time'=>'1528638555']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_sys_addons_binding','apply_time'=>'1528638556']);
        $this->insert('{{%migration}}',['version'=>'m180307_012056_sys_article','apply_time'=>'1528638556']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_article_cate','apply_time'=>'1528638556']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_article_single','apply_time'=>'1528638556']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_article_tag','apply_time'=>'1528638557']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_article_tag_map','apply_time'=>'1528638557']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_auth_assignment','apply_time'=>'1528638557']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_auth_item','apply_time'=>'1528638560']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_auth_item_child','apply_time'=>'1528638562']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_auth_rule','apply_time'=>'1528638562']);
        $this->insert('{{%migration}}',['version'=>'m180307_012057_sys_config','apply_time'=>'1528638562']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_config_cate','apply_time'=>'1528638562']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_desk_menu','apply_time'=>'1528638563']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_manager','apply_time'=>'1528638563']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_menu','apply_time'=>'1528638563']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_notify','apply_time'=>'1528638563']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_notify_cate','apply_time'=>'1528638563']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_notify_manager','apply_time'=>'1528638564']);
        $this->insert('{{%migration}}',['version'=>'m180307_012058_sys_pay_log','apply_time'=>'1528638564']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_attachment','apply_time'=>'1528638564']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_custom_menu','apply_time'=>'1528638564']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_custom_menu_area','apply_time'=>'1528638564']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_fans','apply_time'=>'1528638565']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_fans_stat','apply_time'=>'1528638565']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_fans_tags','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_fans_tag_map','apply_time'=>'1528638565']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_mass_record','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_msg_history','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_news','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_qrcode','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012059_wechat_qrcode_stat','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012100_wechat_reply_addon','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012100_wechat_reply_basic','apply_time'=>'1528638566']);
        $this->insert('{{%migration}}',['version'=>'m180307_012100_wechat_reply_default','apply_time'=>'1528638567']);
        $this->insert('{{%migration}}',['version'=>'m180307_012100_wechat_reply_images','apply_time'=>'1528638567']);
        $this->insert('{{%migration}}',['version'=>'m180307_012100_wechat_reply_music','apply_time'=>'1528638567']);
        $this->insert('{{%migration}}',['version'=>'m180307_012100_wechat_reply_news','apply_time'=>'1528638567']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_reply_user_api','apply_time'=>'1528638567']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_reply_video','apply_time'=>'1528638567']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_reply_voice','apply_time'=>'1528638567']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_rule','apply_time'=>'1528638568']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_rule_keyword','apply_time'=>'1528638568']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_rule_keyword_stat','apply_time'=>'1528638568']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_rule_stat','apply_time'=>'1528638568']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wechat_setting','apply_time'=>'1528638569']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wxapp_account','apply_time'=>'1528638569']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wxapp_general_analysis','apply_time'=>'1528638569']);
        $this->insert('{{%migration}}',['version'=>'m180307_012101_wxapp_versions','apply_time'=>'1528638569']);
        
        /* 设置外键约束 */
        $this->execute('SET foreign_key_checks = 1;');
    }

    public function down()
    {
        $this->execute('SET foreign_key_checks = 0');
        /* 删除表 */
        $this->dropTable('{{%migration}}');
        $this->execute('SET foreign_key_checks = 1;');
    }
}

